function reportTestResult(n,err,sp,precision)
% 
% Report the result of a ppft test.
% This is an internal function called by the test functions.
%
% Yoel Shkolnisky, December 2010.

if strcmp(precision,'single')
    tol = 1e-3;
elseif strcmp(precision,'double')
    tol = 1e-6;
else
    error('precision must be single or double');
end

fprintf('n=%d\tError=%e\t Speedup=%2f\t',n,err,sp);
if err<tol
    fprintf('OK\n');
else
    fprintf('ERR\n');
end
